package com.taylor.spring5.aop;

import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

/**
 * @author taylor
 * @Description: TODO
 * @date 2021/4/4 23:48
 */
@Component
@Aspect
@Order(1)
public class PersonProxy {

    @Pointcut(value = "execution(* com.taylor.spring5.aop.User.add(..))")
    public void pointCut(){
        System.out.println("抽取相同切入点");
    }
    /**
     * 前置通知
     */
    @Before(value = "pointCut()")
    public void before() {
        System. out .println( "pserson before......");
    }

}
